package escom.dds.swing.graficas;

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JButton;

import org.jfree.ui.RefineryUtilities;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class PrincipalGraficas {

	private JFrame frame;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					PrincipalGraficas window = new PrincipalGraficas();
					window.frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public PrincipalGraficas() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frame = new JFrame();
		frame.setBounds(100, 100, 322, 187);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.getContentPane().setLayout(null);

		JLabel lblEstadsticas = new JLabel("Estadísticas");
		lblEstadsticas.setFont(new Font("Dialog", Font.BOLD, 15));
		lblEstadsticas.setBounds(113, 12, 107, 27);
		frame.getContentPane().add(lblEstadsticas);

		JLabel lblPromedio = new JLabel("Promedio");
		lblPromedio.setBounds(30, 55, 70, 15);
		frame.getContentPane().add(lblPromedio);

		JLabel lblCarreras = new JLabel("Carreras");
		lblCarreras.setBounds(30, 86, 70, 15);
		frame.getContentPane().add(lblCarreras);

		JButton btnGraficar = new JButton("graficar");
		btnGraficar.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				Promedios demo = new Promedios("Estadísticas de Calificaciones");
				demo.pack();
				RefineryUtilities.centerFrameOnScreen(demo);
				demo.setVisible(true);
			}
		});
		btnGraficar.setBounds(120, 55, 89, 15);
		frame.getContentPane().add(btnGraficar);

		JButton button = new JButton("graficar");
		button.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				AlumnosXCarrera demo = new AlumnosXCarrera(
						"Estadísticas de Carrera", "Ocupación de Carreras");
				demo.pack();
				demo.setVisible(true);
			}
		});
		button.setBounds(120, 86, 89, 15);
		frame.getContentPane().add(button);
	}
}
